package com.jucai.pppeiyouclient.adapter;

import android.content.Context;
import android.content.Intent;
import android.text.TextUtils;
import android.view.View;

import com.jucai.pppeiyouclient.R;
import com.jucai.pppeiyouclient.base.CommonRecyclerViewAdapter;
import com.jucai.pppeiyouclient.bean.MerchantServiceBean;
import com.jucai.pppeiyouclient.utils.LogUtils;
import com.jucai.pppeiyouclient.utils.SharedPreferencesUtil;
import com.jucai.pppeiyouclient.view.activity.BrowserActivity;
import com.jucai.pppeiyouclient.view.activity.CommonH5Activity;

import java.util.List;

import static android.content.ContentValues.TAG;

/**
 * Created by Kuky on 2017-05-06.
 */

public class MerchantServiceAdapter extends CommonRecyclerViewAdapter<MerchantServiceBean> {

    public MerchantServiceAdapter(Context context, List<MerchantServiceBean> data) {
        super(context, data);
    }

    @Override
    public void bindHolder(CommonHolder holder, final MerchantServiceBean merchantServiceBean) {
        holder.setText(R.id.merchant_price, "支出：" + merchantServiceBean.getPrice());
        holder.setText(R.id.merchant_expenditure, "商品：" + merchantServiceBean.getGoods_name());
        holder.setText(R.id.merchant_time, "购买时间：" + merchantServiceBean.getCreate_time());


        /**
         * status
         * 0 --> 未消费
         * 1 ---> 已消费
         * 2 ---> 已退款
         * 3 ---> 拒退款
         */
//        switch (merchantServiceBean.getStatus()) {
//            case 0:
//                holder.setImage(R.id.merchant_status, R.drawable.ic_not_consumed, 40, 40);
//                break;
//            case 1:
//                holder.setImage(R.id.merchant_status, R.drawable.ic_consume, 40, 40);
//                break;
//            case 2:
//                holder.setImage(R.id.merchant_status, R.drawable.ic_refunded, 40, 40);
//                break;
//            case 3:
//                holder.setImage(R.id.merchant_status, R.drawable.ic_refund_denied, 40, 40);
//                break;
//
//        }
    }

    @Override
    protected int getItemType(int position) {
        return 0;
    }

    @Override
    public int getLayoutId(int viewType) {
        return R.layout.item_merchant_service_layout;
    }
}
